/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.colegiatura.be.Cronograma;
import org.cip.esymons.colegiatura.be.Detallecronograma;

/**
 *
 * @author ADMINISTRADOR
 */
public class DetalleCronogramaDelegate {


    private DetallecronogramaFacadeLocal local;

    public DetalleCronogramaDelegate() {

        local = lookupDetallecronogramaFacade();
    }

    public void create(Detallecronograma detallecronograma){

        local.create(detallecronograma);
    }

    public void edit(Detallecronograma detallecronograma){

        local.edit(detallecronograma);
    }

    public void remove(Detallecronograma detallecronograma){

        local.remove(detallecronograma);
    }

    public Detallecronograma find(Object id){

        return local.find(id);
    }

    public List<Detallecronograma> findAll(){

        return local.findAll();
    }
    public List<Detallecronograma> buscaPorCronograma(Cronograma cronograma){

        return local.buscaPorCronograma(cronograma);
    }

    private DetallecronogramaFacadeLocal lookupDetallecronogramaFacade() {
        try {
            Context c = new InitialContext();
            return (DetallecronogramaFacadeLocal) c.lookup("java:comp/env/DetallecronogramaFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }



}
